package com.zdf.license.verify.config;

import com.zdf.license.core.model.LicenseVerifyParam;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * License验证属性类
 */
@Component
@Data
@NoArgsConstructor
@AllArgsConstructor
@ConfigurationProperties(prefix = "license.verify")
public class LicenseVerifyProperties {
    private String subject = "cspt";
    private String publicAlias = "publiccert";
    private String publicKeysStorePath = "/publicCerts.store";
    private String storePass = "wsn++123";
    private String licensePath = "license.lic";

    public LicenseVerifyParam getVerifyParam() {
        return LicenseVerifyParam.builder()
                .subject(subject)
                .publicAlias(publicAlias)
                .storePass(storePass)
                .licensePath(licensePath)
                .publicKeysStorePath(publicKeysStorePath)
                .build();
    }
}
